<span page-title ng-model="host">{{ 'Content Host:' | translate }} {{ host.name }}</span>

<div data-extend-template="layouts/details-page-with-breadcrumbs.html">
  <header data-block="header" translate>
    {{ host.name }}
  </header>

  <nav data-block="item-actions">
    <button class="btn btn-default" type="button"
            ng-disabled="host.deleting"
            ng-hide="denied('destroy_hosts', host)"
            ng-click="openModal()">
      <span translate>Unregister Host</span>
    </button>

    <div bst-modal="unregisterContentHost(host)" model="host">
      <div data-block="modal-header" translate>
        Unregister Host "{{host.name}}"?
      </div>
      <div data-block="modal-body">
        <p translate>
          Unregister Options:
        </p>

        <p class="alert alert-warning" ng-show="host.deleteHostOnUnregister" translate>
          This operation may also remove managed resources linked to the host such as virtual machines and DNS records.
          Change the setting "Delete Host upon Unregister" to false on the <a href="/settings">settings page</a> to prevent this.
        </p>

        <p ng-show="host.hasSubscription()" class="radio" ng-class="{disabled: host.deleteHostOnUnregister}">
          <label>
            <input name="unregister"
                   ng-disabled="host.deleteHostOnUnregister"
                   ng-model="host.unregisterDelete"
                   ng-value="false"
                   type="radio" />
            <span translate>Unregister the host as a subscription consumer.  Provisioning and configuration information is preserved.</span>
            <span class="help-block" ng-show="host.deleteHostOnUnregister">This option is disabled because the setting "Delete Host upon unregister" is set.</span>
          </label>
        </p>

        <p class="radio">
          <label>
            <input name="delete"
                   ng-model="host.unregisterDelete"
                   ng-value="true"
                   type="radio" />
            <span translate>Completely deletes the host including VM and disks, and removes all reporting, provisioning, and configuration information.</span>
          </label>
        </p>
      </div>
    </div>
  </nav>

  <nav data-block="navigation">
    <div content-access-mode-banner></div>
    <ul class="nav nav-tabs">
      <li ng-class="{active: isState('content-host.info')}">
        <a translate
           ui-sref="content-host.info">
          Details
        </a>
      </li>
      <li ng-class="{active: isState('content-host.provisioning')}"
          bst-feature-flag="remote_actions">
        <a translate
           ui-sref="content-host.provisioning">
          Provisioning Details
        </a>
      </li>
      <li uib-dropdown
          ng-if="!simpleContentAccessEnabled"
          ng-class="{active: stateIncludes('content-host.subscriptions.list') || stateIncludes('content-host.subscriptions.add')}">
        <a translate
           ui-sref="content-host.subscriptions.list">
          Subscriptions
        </a>
      </li>
      <li ng-class="{active: $state.includes('content-host.host-collections')}">
        <a translate
           ui-sref="content-host.host-collections.list">
          Host Collections
        </a>
      </li>
      <li ng-class="{active: stateIncludes('content-host.tasks')}">
        <a translate
           ui-sref="content-host.tasks.index">
          Tasks
        </a>
      </li>
      <li uib-dropdown ng-if="host.isRpmEnabled()"
          ng-class="{active: stateIncludes('content-host.packages-actions') || stateIncludes('content-host.packages-installed') || stateIncludes('content-host.packages-upgradeable')}" >
        <a uib-dropdown-toggle>
          <span translate>Packages</span>
          <i class="fa fa-chevron-down"></i>
        </a>
        <ul uib-dropdown-menu>
          <li>
            <a ui-sref="content-host.packages.actions" ng-hide="denied('edit_hosts')" translate>
              Actions
            </a>
          </li>
          <li>
            <a ui-sref="content-host.packages.installed" translate>
              Installed
            </a>
          </li>
          <li>
            <a ui-sref="content-host.packages.applicable" translate>
              Applicable
            </a>
          </li>
        </ul>
      </li>
      <li uib-dropdown ng-if="host.isDebEnabled()"
          ng-class="{active: stateIncludes('content-host.debs-actions') || stateIncludes('content-host.debs-installed') || stateIncludes('content-host.debs-upgradeable')}" >
        <a uib-dropdown-toggle>
          <span translate>Deb Packages</span>
          <i class="fa fa-chevron-down"></i>
        </a>
        <ul uib-dropdown-menu>
          <li>
            <a ui-sref="content-host.debs.actions" translate>
              Apt Actions
            </a>
          </li>
          <li ng-class="{active: isState('content-host.debs-installed')}">
            <a translate
               ui-sref="content-host.debs.installed">
              Installed
            </a>
          </li>
        </ul>
      </li>
      <li ng-class="{active: isState('content-host.errata.index')}">
        <a translate
           ui-sref="content-host.errata.index">
          Errata
        </a>
      </li>
      <li ng-class="{active: isState('content-host.module-streams.index')}">
        <a translate
           ui-sref="content-host.module-streams.index">
          Module Streams
        </a>
      </li>
      <li ng-class="{active: isState('content-host.traces.index')}">
        <a translate
           ui-sref="content-host.traces.index">
          Traces
        </a>
      </li>
      <li ng-hide="denied('view_products')" ng-class="{active: isState('content-host.products')}">
        <a ui-sref="content-host.products" translate>
          Repository Sets
        </a>
      </li>
      <li ng-repeat="menuItem in menuExpander.getMenu('host')">
        <a href="{{ menuItem.url }}">
          {{ menuItem.label }}
        </a>
      </li>
    </ul>
  </nav>

  <div data-block="content">
    <section ui-view></section>
  </div>
</div>
